{layout name="passport:layout" /}
<div id="actionbar">
    <a href="javascript:;" url="{:url('passport.member/staffAdd')}" class="button button-blue win"><i class="iconfont icon-add_icon"></i>添加员工</a>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w70"></th>
            <th class="w160">所属应用</th>
            <th>用户</th>
            <th class="w200">用户权限</th>
            <th class="w140">登录IP</th>
            <th class="w140">登录时间</th>
            <th class="w140">创建时间</th>
            <th class="w70 fn-tac">状态</th>
            <th class="w150">操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $list as $vo}
        <tr>
            <td class="fn-tac"><img class="w50" src="{$vo.logo}" style="border-radius: 10px;"></td>
            <td>{$vo.miniapp.appname}</td>
            <td>
                <a href="javascript:;" class="win" url="{:url('passport.member/staffEdit',array('id'=>$vo.id))}" title="编辑">
                    <span class="iconfont icon-my_icon"></span> {$vo.username}
                    <p class="gray"><span class="iconfont icon-phone"></span>{$vo.phone_id}</p>
                </a>
            </td>
            <td>{if $vo.auth}{foreach $vo.auth_group as $rs}{if $rs.auth == $vo.auth}{$rs.name}{/if}{/foreach}{else}超级管理员{/if}</td>
            <td>{$vo.login_ip}</td>
            <td>{$vo->login_time|date='Y-m-d H:i'}</td>
            <td>{$vo->create_time|date='Y-m-d H:i'}</td>
            <td class="fn-tac li">
                <sapn class="isLock fn-cp" url="{:url('passport.member/staffLock',array('id'=>$vo.id))}" href="javascript:;" title="锁定/解锁">
                    {if $vo.is_lock}<span class="badge bg-red">锁定</span>{else}<span class="badge">正常</span>{/if}
                </sapn>
            </td>
            <td class="button-group">
                <sapn class="button win" url="{:url('passport.member/staffEdit',array('id'=>$vo.id))}" title="编辑"><i class="iconfont icon-edit"></i>编辑</sapn>
                <sapn class="button isDel" url="{:url('passport.member/staffDelete',['id'=>$vo.id])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i>删除</sapn>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
<div class="page">{$list|raw}</div>
<script type="text/javascript">
Do('base', 'layer', function () {
    $('.isDel').isDel();
    $('.win').win({area:["650px", "400px"],reload:1});
    $('.isLock').click(function () {
        var url = $(this).attr("url");
        parent.layer.confirm('确认要锁定当前用户?',{ icon: 3,title: '友情提示' }, function (index) {
            $.getJSON(url, function (data) {window.location.reload();});
            parent.layer.close(index);
        });
    })
})
</script>